@import '../variables/default.scss';
@import '../mixins/index.scss';

$at-radio-prefixCls: '.at-radio';
$at-radio-tag-prefixCls: '.at-radio-tag';

#{$at-radio-tag-prefixCls} {
  background-color: $color-bg;
  display: flex;
  flex-wrap: wrap;

  /* tag elements */
  #{$at-radio-prefixCls}__last {
    margin-right: 0 !important;
  }

  #{$at-radio-prefixCls}__tag {
    display: inline-block;
    position: relative;
    text-align: center;
    box-sizing: border-box;
    border-width: 2px;
    border-style: solid;
    border-radius: $border-radius-md;
    height: 66px;
    margin-top: 12px;
    margin-bottom: 12px;
    margin-right: 24px;
    border-color: #f5f5f5;
    background-color: #f5f5f5;
    line-height: 66px;
    color: $color-grey-1;
    font-size: 26px;

    &--large {
      padding: 0 26px;
      height: 66px;
      font-size: 26px;
      line-height: 66px;
    }

    &--checked {
      border-color: rgba(22, 119, 255, 0.4);
      background-color: #e7f1ff;
      color: #1677ff;
    }

    &--disabled {
      opacity: 0.4;
    }
  }
}

#{$at-radio-prefixCls} {
  position: relative;
  background-color: $color-bg;
  @include hairline-top-relative();
  @include hairline-bottom-relative();

  /* elements */
  &__option-wrap {
    padding: $spacing-v-lg $spacing-h-xl $spacing-v-lg 0;
  }

  &__option-container {
    display: flex;
  }

  &__title {
    flex: 6;
    color: $at-radio-title-color;
    font-size: $at-radio-title-size;
    text-align: left;
    line-height: $line-height-zh;
    word-break: break-all;
  }

  &__icon {
    flex: 1;
    font-size: $at-radio-title-size;
    text-align: right;
    overflow: hidden;
    visibility: hidden;

    &--checked {
      visibility: visible;
    }

    .at-icon {
      color: $at-radio-check-color;
    }
  }

  &__desc {
    display: block;
    width: 86%;
    color: $at-radio-desc-color;
    font-size: $at-radio-desc-size;
    text-align: left;
    line-height: $line-height-zh;
    letter-spacing: 0;
    word-break: break-all;
  }

  &__option {
    padding-left: $spacing-h-xl;
    @include active;

    &--disabled {
      .at-radio__option-container,
      .at-radio__desc {
        opacity: $opacity-disabled;
      }

      &:active {
        background-color: inherit;
      }
    }
  }

  &__option + &__option {
    .at-radio__option-wrap {
      @include hairline-top();
    }
  }
}

.radio-tag-list {
  padding-top: 0;
  padding-bottom: 0;

  .item-extra__info {
    display: flex;
    flex-direction: row-reverse;
    padding-right: 0;
  }
}
